import { createApp } from 'vue'; 
import Mitt from 'mitt' 
  
const emitter = Mitt();  
  
export function useEventBus() {  
  return emitter;  
}  
  
// 在 main.ts 中提供全局访问  
export function setupApp(app: ReturnType<typeof createApp>) {  
  app.config.globalProperties.$eventBus = useEventBus();  
}